package com.infoDiffusion.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "material")
public class MaterialBean {

	private Integer id;
	private String name;
	private String type; // 类别
	private String dept; // 所属单位
	private Long num; // 物资数量
	private String unit; // 计量单位
	private String address; // 存放地址
	private Date storageBeginTime; // 物资存入时间
	private Date efficiencyTime;// 有效时间
	private UserBean userBean;
	
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "dept")
	public String getDept() {
		return dept;
	}

	public void setDept(String dept) {
		this.dept = dept;
	}

	@Column(name = "num")
	public Long getNum() {
		return num;
	}

	public void setNum(Long num) {
		this.num = num;
	}

	@Column(name = "unit")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "address")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "storage_begin_time")
	public Date getStorageBeginTime() {
		return storageBeginTime;
	}

	public void setStorageBeginTime(Date storageBeginTime) {
		this.storageBeginTime = storageBeginTime;
	}
	
	@Column(name = "efficiency_time")
	public Date getEfficiencyTime() {
		return efficiencyTime;
	}

	public void setEfficiencyTime(Date efficiencyTime) {
		this.efficiencyTime = efficiencyTime;
	}
	@ManyToOne
	@JoinColumn(name="user_id")
	public UserBean getUserBean() {
		return userBean;
	}

	public void setUserBean(UserBean userBean) {
		this.userBean = userBean;
	}

	public MaterialBean(String type, Long num, String unit) {
		
		this.type = type;
		this.num = num;
		this.unit = unit;
	}
	
	public MaterialBean(){
		super();
	}
	

}
